﻿using MyCSharpWork5.Regression.Models;

namespace Regression
{
    internal class Program
    {
        /// <summary>
        /// 最小二乘法预测GDP
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            //从数据文件读取数据
            var model = new RegressionModel();
            //如何写路径：@$"   "
            model.X = MyFunctions.ListReadTxt(@$"D:\temp\Csharp\MyCSharpWork5\DataFiles\Year.txt");
            model.Y = MyFunctions.ListReadTxt(@$"D:\temp\Csharp\MyCSharpWork5\DataFiles\Gdp.txt");
            //计算参数
            model.Compute();
            //预测
            model.Forecast(2022);            
            Console.ReadKey();
        }
    }
}


